/*
board-games:	An educational framework for board games programming.
    Copyright (C) 2008  Daniel Gutson, FuDePAN
    
    This file is part of board-games.

    board-games is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    board-games is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
*/

#include "tictactoe_proxy.h"

void init_player(enum PLAYERS p)
{
    /* nothing to initialize here */
}


void play(const TTTBoard board, Coord* row, Coord* col)
{
    int found;
    /* find first empty */
    *row = *col = 0;

    do
    {
        found = (board[*row][*col] == BOARD_EMPTY);
        if (!found)
        {
            (*col)++;
            if (*col == BOARD_SIZE)
            {
                *col = 0;
                (*row)++;
            }
        }
    }
    while (!found && *row < BOARD_SIZE);
}
